# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.FusionTables.V2.Model.Table do
  @moduledoc """
  Represents a table.

  ## Attributes

  *   `attribution` (*type:* `String.t`, *default:* `nil`) - Attribution assigned to the table.
  *   `attributionLink` (*type:* `String.t`, *default:* `nil`) - Optional link for attribution.
  *   `baseTableIds` (*type:* `list(String.t)`, *default:* `nil`) - Base table identifier if this table is a view or merged table.
  *   `columnPropertiesJsonSchema` (*type:* `String.t`, *default:* `nil`) - Default JSON schema for validating all JSON column properties.
  *   `columns` (*type:* `list(GoogleApi.FusionTables.V2.Model.Column.t)`, *default:* `nil`) - Columns in the table.
  *   `description` (*type:* `String.t`, *default:* `nil`) - Description assigned to the table.
  *   `isExportable` (*type:* `boolean()`, *default:* `nil`) - Variable for whether table is exportable.
  *   `kind` (*type:* `String.t`, *default:* `fusiontables#table`) - The kind of item this is. For a table, this is always fusiontables#table.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Name assigned to a table.
  *   `sql` (*type:* `String.t`, *default:* `nil`) - SQL that encodes the table definition for derived tables.
  *   `tableId` (*type:* `String.t`, *default:* `nil`) - Encrypted unique alphanumeric identifier for the table.
  *   `tablePropertiesJson` (*type:* `String.t`, *default:* `nil`) - JSON object containing custom table properties.
  *   `tablePropertiesJsonSchema` (*type:* `String.t`, *default:* `nil`) - JSON schema for validating the JSON table properties.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :attribution => String.t(),
          :attributionLink => String.t(),
          :baseTableIds => list(String.t()),
          :columnPropertiesJsonSchema => String.t(),
          :columns => list(GoogleApi.FusionTables.V2.Model.Column.t()),
          :description => String.t(),
          :isExportable => boolean(),
          :kind => String.t(),
          :name => String.t(),
          :sql => String.t(),
          :tableId => String.t(),
          :tablePropertiesJson => String.t(),
          :tablePropertiesJsonSchema => String.t()
        }

  field(:attribution)
  field(:attributionLink)
  field(:baseTableIds, type: :list)
  field(:columnPropertiesJsonSchema)
  field(:columns, as: GoogleApi.FusionTables.V2.Model.Column, type: :list)
  field(:description)
  field(:isExportable)
  field(:kind)
  field(:name)
  field(:sql)
  field(:tableId)
  field(:tablePropertiesJson)
  field(:tablePropertiesJsonSchema)
end

defimpl Poison.Decoder, for: GoogleApi.FusionTables.V2.Model.Table do
  def decode(value, options) do
    GoogleApi.FusionTables.V2.Model.Table.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.FusionTables.V2.Model.Table do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
